import request from '@/utils/request'
import qs from 'qs'

export let getlist = (params) => {
  return request({
    url: "/exam/exam",
    method: "get",
    params: params || {},
    baseURL: "http://localhost:2345"
  })
}

export let delexam = (id) => {
  return request({
    url: "/exam/delexam",
    method: "get",
    params: {id},
    baseURL: "http://localhost:2345"
  })
}

export let addexam = (data) => {
  return request({
    url: "/exam/addexam",
    method: "post",
    data: qs.stringify(data),
    baseURL: "http://localhost:2345"
  })
}

// export let updatelist = (data) => {
//   return request({
//     url: "/exam/updateList",
//     method: "post",
//     data: qs.stringify(data),
//     baseURL: "http://localhost:2345"
//   })
// }

export let addtopic = (params) => {
  return request({
    url: "/exam/addtopic",
    method: "get",
    params,
    baseURL: "http://localhost:2345"
  })
}